package com.rede.didiok.common.feign;

import java.util.Collection;
import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import com.rede.didiok.common.config.feign.FeignConfiguration;
import com.rede.didiok.common.dto.community.*;
import com.rede.didiok.common.utils.R;


/**
 * didiok-rank 相关接口
 *
 */
@FeignClient(name = "didiok-user", contextId = "didiok-community1", configuration = FeignConfiguration.class)
public interface CommunityFeignClient {

    /**
     * 用户动态下架
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/revocation", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R revocationMoment(@RequestParam("uid") String uid);

    /**
     * 批量同步用户动态索引
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/buildAggDoc", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String buildMomentAggDoc();

    /**
     * 获取用户动态列表
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/getList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getUserMomentPageList(@RequestBody UserMomentDto userMomentDto);

    /**
     * 增加榜单成员等级
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/add", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String addUserMoment(@RequestBody UserMomentDto userMomentDto);

    /**
     * 编辑榜单成员等级
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/edit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String editUserMoment(@RequestBody UserMomentDto userMomentDto);

    /**
     * 批量删除榜单成员等级
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/deleteBatch", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String deleteBatchUserMoment(@RequestBody List<UserMomentDto> userMomentDtoList);

    /**
     * 审核用户动态
     * @param userMomentDto
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/audit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String auditMoment(@RequestBody UserMomentDto userMomentDto);

    /**
     * 获取用户动态话题列表
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMomentTopic/getList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getUserMomentTopicPageList(@RequestBody UserMomentTopicDto userMomentTopicDto);

    /**
     * 获取用户动态话题列表
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMomentTopic/add", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String addUserMomentTopic(@RequestBody UserMomentTopicDto userMomentTopicDto);

    /**
     * 编辑用户动态话题
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMomentTopic/edit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String editUserMomentTopic(@RequestBody UserMomentTopicDto userMomentTopicDto);

    /**
     * 批量删除用户动态话题
     * @param fileUid
     * @return
     */
    @RequestMapping(value = "/community/feign/userMomentTopic/deleteBatch", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String deleteBatchUserMomentTopic(@RequestBody List<UserMomentTopicDto> userMomentTopicDtoList);


    /**
     * 根据id获取用户动态评论
     * @param
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/getCommentById", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R getCommentById(@RequestParam("uid") String uid);

    /**
     * 根据id获取用户动态
     * @param
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/getById", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R getUserMomentById(@RequestParam("uid") String uid);

    /**
     * 评论下架
     * @param
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/revocation", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R revocationComment(@RequestParam("uid") String uid);

    /**
     * 根据用户列表ID  查询各用户发表博客数
     * @param userUids
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/getUserMomentCountByUserIds", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R getUserMomentCountByUserIds(@RequestParam("userUids") List<String> userUids);

    /**
     * 根据用户列表ID  查询各用户评论数
     * @param
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/getCommentCountByUserIds", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R getCommentCountByUserIds(@RequestParam("userUids") List<String> userUids);

    /**
     * 获取动态数目
     *
     * @param userMomentVO
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/getCount", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    Integer getUserMomentCount(@RequestParam("userUid") String userUid);

    /**
     * 获取评论数量
     * @param createUserUid
     * @param memberUid
     * @param toUserUid
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/getCommentCount", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    Integer getCommentCount(@RequestParam("createUserUid")String createUserUid, @RequestParam("momentUid")String momentUid, @RequestParam("toUserUid")String toUserUid);

    /**
     * 审核评论
     * @param memberCommentDto
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/audit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String auditComment(@RequestBody MomentCommentDto momentCommentDto);

    /**
     * 获取评论列表
     * @param memberCommentDto
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/getList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getCommentPageList(@RequestBody MomentCommentDto momentCommentDto);

    /**
     * 添加评论
     * @param memberCommentDto
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/add", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String addComment(@RequestBody MomentCommentDto momentCommentDto);

    /**
     * 编辑评论
     * @param memberCommentDto
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/edit", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String editComment(@RequestBody MomentCommentDto momentCommentDto);

    /**
     * 删除评论
     * @param memberCommentDto
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String deleteComment(@RequestBody MomentCommentDto momentCommentDto);

    /**
     * 批量删除评论
     * @param commentVoList
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/deleteBatch", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String deleteBatchComment(@RequestBody List<MomentCommentDto> commentDtoList);


    /**
     * 根据id集合查询评论
     * @param uidList
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/getCommentPageListByIds", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getCommentPageListByIds(@RequestParam("uidList") Collection<String> uidList);

    /**
     * 根据id集合查询用户动态
     * @param uidList
     * @return
     */
    @RequestMapping(value = "/community/feign/userMoment/listUserMomentByUidList", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R listUserMomentByUidList(@RequestParam("uidList") List<String> uidList);


    /**
     * 添加评论（当该评论不是一级评论时，需要设置一级评论UID字段）
     * @param comment
     * @return
     */
    @RequestMapping(value = "/community/feign/momentComment/addCommentWithFirstCommentUid", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R addCommentWithFirstCommentUid(@RequestBody MomentCommentDto comment);


    /**
     * 获取举报列表
     *
     * @param noticeVO
     */
    @PostMapping(value = "/community/feign/report/getList", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    String getReportPageList(@RequestBody CommunityReportDto reportDto);

    /**
     * 获取举报列表
     *
     * @param noticeVO
     */
    @PostMapping(value = "/community/feign/praiseRecord/getCommunityPraiseCount", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    Integer getCommunityPraiseCount(@RequestBody CommunityPraiseRecordDto userPraiseRecordVO);

    /**
     * 根据id更新评论
     * @param rankPraiseRecordDto
     * @return
     */
    @PostMapping(value = "/community/feign/praiseRecord/updateById", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8")
    R updatePraiseRecordById(@RequestBody CommunityPraiseRecordDto communityPraiseRecordDto);

}